import { ref } from 'vue'
import { number } from '@intlify/core-base'

/* ucharts柱状图操作图表 */
export const chartDatas = {
  categories: [
  ],
  series: [
    {
      name: '',
      data: [
        {
          value: 319
        },
        {
          value: 846
        },
        {
          value: 470
        },
        {
          value: 1365
        },
        {
          value: 1624
        },
        {
          value: 1190
        },
        {
          value: 1877
        }
      ],
      show: true,
      textColor: '#9EAFFA',
      color: '#3E5FF5'
    }
  ]
}

/* ucharts柱状图操作图表 */
export const chartDatasTwo = {
  categories: [
  ],
  series: [
    {
      name: '开通数',
      data: [
        {
          value: 319,
          color: '#3E5FF5'
        },
        {
          value: 846,
          color: '#3E5FF5'
        },
        {
          value: 470,
          color: '#3E5FF5'
        },
        {
          value: 1365,
          color: '#3E5FF5'
        },
        {
          value: 1624,
          color: '#3E5FF5'
        },
        {
          value: 1190,
          color: '#3E5FF5'
        },
        {
          value: 1877,
          color: '#3E5FF5'
        }
      ],
      show: true,
      textColor: '#9EAFFA'
    }
  ]
}

/* ucharts柱状图操作图表 */
export const chartDatasThree = {
  categories: [
  ],
  series: [
    {
      name: '',
      data: [
        {
          value: 319,
          color: '#3E5FF5'
        },
        {
          value: 846,
          color: '#3E5FF5'
        },
        {
          value: 470,
          color: '#3E5FF5'
        },
        {
          value: 1365,
          color: '#3E5FF5'
        },
        {
          value: 1624,
          color: '#3E5FF5'
        },
        {
          value: 1190,
          color: '#3E5FF5'
        },
        {
          value: 1877,
          color: '#3E5FF5'
        }
      ],
      show: true,
      textColor: '#9EAFFA'
    }
  ]
}

export const chartDataAdds = {
  categories: [] as string[],
  series: [
    {
      name: '加保人数',
      data: [] as string[],
      color: '#3E5FF5'
    },
    {
      name: '减保人数',
      data: [] as string[],
      color: '#FF7642'
    }
  ]
}

export const opt = {
  dataLabel: false,
  padding: [25, 15, 0, 5],
  enableMarkLine: false,
  legend: {
    show: false,
    fontColor: 'red'
  },
  xAxis: {
    axisLine: false,
    disabled: false,
    calibration: false,
    fontSize: 10
  },
  yAxis: {
    disableGrid: false,
    splitNumber: 4,
    padding: 30,
    data: [
      {
        min: 0,
        axisLine: false,
        fontSize: 10,
        disabled: false,
        showTitle: false,
        titleFontColor: '9497B1',
        fontColor: '#9497B1'
      }
    ]
  },
  extra: {
    column: {
      type: 'group',
      width: 6,
      activeBgColor: '#FFFFFF',
      activeBgOpacity: 0.08,
      seriesGap: 0,
      labelFontColor: '#9497B1'
      // barBorderRadius: [6, 6, 6, 6]
    },
    markLine: {
      data: [
        {
          value: 21,
          // showLabel: true,
          labelBgColor: 'red'
        }
      ]
    },
    tooltip: {
      showBox: true
    }
  }
}

export const chartsDataPies = {
  series: [
    {
      data: [
      ]
    }
  ]
}

export const chartsDataPiesTwo = {
  series: [
    {
      data: [
      ]
    }
  ]
}
//
// * @param {String} 格式化字符串 格式如：YYYY-mm-dd HH:MM:SS
// * @param {Date} date对象
// * @return {}
// export const chartDataFun = (oneValue:any, twoValue:any, threeValue:any, fourValue:any) => {
//   oneValue = threeValue.map((item: string, index:number) => {
//   console.log(item.split('-')[1] + '/' + item.split('-')[2], 'itemitemitem')
//   // index = item.value
//   return item.split('-')[1] + '/' + item.split('-')[2]
// })
//
//   twoValue = fourValue.map((item: string, index:number) => {
//   console.log(item, 'moneymoney')
//   // index = item.value
//   return { value: item, color: '#3E5FF5' }
// })
// }
